#ifndef _COMMON_H_
#define _COMMON_H_

#include <stdint.h>
#include <math.h>

#define TIMING
#define MAX_PIXELS						57 // 50000 is too much, so use 5000 pixels * 24 bits per pixel = 120 KBytes can fit in spu

// Some alignment macros
#define QWORD_ALIGNED __attribute__((aligned(16)))
#define CACHE_ALIGNED __attribute__((aligned(128)))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
typedef unsigned long long ea_t;

// Control block, for DMA
typedef struct _CONTROL_BLOCK {
	ea_t originalPixels QWORD_ALIGNED;
	ea_t changedPixels QWORD_ALIGNED;
} CONTROL_BLOCK;

typedef struct
{
	char red;
	char green;
	char blue;
}PIXEL;

#endif
